package collections1;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Xue {
	public static void main(String[] args) {
		Calendar format = Calendar.getInstance();
		for (int k = 0; k < 12; k++) {
			format.set(Calendar.MONTH, k);
			format.set(Calendar.HOUR_OF_DAY, 8);
			int MaxDay = format.getActualMaximum(Calendar.DAY_OF_MONTH);
			int saturday = 0;
			for (int i = MaxDay; i > 15; i--) {
				format.set(Calendar.DATE, i);
				if (format.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) {
					saturday++;
					if (saturday == 2) {
						break;
					}
				}
			}
			String date = new SimpleDateFormat("yyyy-MM-dd hh时").format(format.getTime());
			System.out.println("每个月考试时间是：" + date);

		}
	}
}